package com.dennytech.tac.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;

import com.dennytech.tac.base.FragmentTabActivity;
import com.dennytech.tac.ui.fragment.HomeFragment;
import com.dennytech.tac.ui.fragment.MoreFragment;
import com.dennytech.tac.ui.fragment.TimelineFragment;
import com.dennytech.tac.ui.fragment.TogoFragment;
import com.dennytech.tac.utils.CFUtils;
import com.dennytech.tac.R;

public class MainActivity extends FragmentTabActivity {

	@Override
	protected int customTitleType() {
		return TITLE_TYPE_NONE;
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		// setTabWidgetBackground(R.drawable.tab_bar_bg);
		addTab(getResources().getString(R.string.tab_name_home),
				HomeFragment.class, null);
		addTab(getResources().getString(R.string.tab_name_timeline),
				TimelineFragment.class, null);
		addTab(getResources().getString(R.string.tab_name_togo),
				TogoFragment.class, null);
		addTab(getResources().getString(R.string.tab_name_more),
				MoreFragment.class, null);

		// mTabHost.getTabWidget().setVisibility(View.GONE);

		setTitle("China Footprint");
	}

	@Override
	protected void initView() {
		setContentView(R.layout.fragment_tabs_bottom);
	}

	@Override
	protected void addTitleShadowView() {
		FrameLayout rootFrame = (FrameLayout) findViewById(android.R.id.content);
		rootFrame.setBackgroundResource(R.drawable.main_background_light);
		View shadow = getLayoutInflater().inflate(R.layout.title_shadow,
				rootFrame, false);
		shadow.setPadding(0, CFUtils.dip2px(this, 45), 0, 0);
		rootFrame.addView(shadow);
	}

}
